package com.sk.domain;

import java.sql.Timestamp;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Shopcart entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "shopcart")
public class Shopcart implements java.io.Serializable {

	// Fields
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Integer id;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "gid")
	private Good good;
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "uid")
	private User user;
	private Timestamp addtime;

	// Constructors

	/** default constructor */
	public Shopcart() {
	}

	/** full constructor */
	public Shopcart(Good good, User user, Timestamp addtime) {
		this.good = good;
		this.user = user;
		this.addtime = addtime;
	}

	// Property accessors

	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Good getGood() {
		return this.good;
	}

	public void setGood(Good good) {
		this.good = good;
	}

	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Timestamp getAddtime() {
		return this.addtime;
	}

	public void setAddtime(Timestamp addtime) {
		this.addtime = addtime;
	}

}